package com.weetop.aklyscan.presenter;

import android.app.Activity;

import androidx.databinding.BaseObservable;

import com.weetop.aklyscan.base.mvp.BaseModel;
import com.weetop.aklyscan.base.mvp.BaseObserver;
import com.weetop.aklyscan.base.mvp.BasePresenter;
import com.weetop.aklyscan.bean.BaseList;
import com.weetop.aklyscan.bean.MatterRecordListBean;
import com.weetop.aklyscan.bean.OutRecordListBean;
import com.weetop.aklyscan.bean.RecordBean;
import com.weetop.aklyscan.bean.RecordListBean;
import com.weetop.aklyscan.bean.SerailBean1;
import com.weetop.aklyscan.bean.THRecordBean;
import com.weetop.aklyscan.view.RecordView;

import java.util.List;

public class RecordPresent extends BasePresenter<RecordView> {

    public RecordPresent(RecordView baseView, Activity activity) {
        super(baseView, activity);
    }

    public void Into27(String order_type, String order_sn) {
        addDisposable(apiServer.Into27(order_type, order_sn), new BaseObserver<BaseModel<List<RecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<RecordListBean>> o) {
                baseView.getInto27Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into28(String order_type, String order_sn, String date) {
        addDisposable(apiServer.Into28(order_type, order_sn, date), new BaseObserver<BaseModel<List<RecordBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<RecordBean>> o) {
                baseView.getInto28Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into77() {
        addDisposable(apiServer.Into77(), new BaseObserver<BaseModel<String>>(baseView) {
            @Override
            public void onSuccess(BaseModel<String> o) {
                baseView.getInto77Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void newInto29(String order_sn) {
        addDisposable(apiServer.Into29(order_sn), new BaseObserver<BaseModel<List<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<OutRecordListBean>> o) {
                baseView.getInto29Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into29(String order_sn, String startTime, String endTime) {
        addDisposable(apiServer.Out09(order_sn, startTime, endTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Out13(String order_sn, String startTime, String endTime) {
        addDisposable(apiServer.Out13(order_sn, startTime, endTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Out12(String order_sn, String startTime) {
        addDisposable(apiServer.Out12(order_sn, startTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Out14(String order_sn, String startTime) {
        addDisposable(apiServer.Out14(order_sn, startTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Out16(String order_sn, String startTime) {
        addDisposable(apiServer.Out16(order_sn, startTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }


    public void Out11(String order_sn, String startTime, String endTime) {
        addDisposable(apiServer.Out11(order_sn, startTime, endTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Out15(String order_sn, String startTime, String endTime) {
        addDisposable(apiServer.Out15(order_sn, startTime, endTime), new BaseObserver<BaseModel<BaseList<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<OutRecordListBean>> o) {
                baseView.getOut09Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into75(String order_sn) {
        addDisposable(apiServer.Into75(order_sn, "1", "10000"), new BaseObserver<BaseModel<BaseList<MatterRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<MatterRecordListBean>> o) {
                baseView.getInto75Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into76(String startTime, String order_sn) {
        addDisposable(apiServer.Into76(startTime, order_sn, "1", "10000"), new BaseObserver<BaseModel<BaseList<MatterRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<BaseList<MatterRecordListBean>> o) {
                baseView.getInto75Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void serail12(String order_sn) {
        addDisposable(apiServer.serail12(order_sn, "1", "10000"), new BaseObserver<BaseModel<SerailBean1>>(baseView) {
            @Override
            public void onSuccess(BaseModel<SerailBean1> o) {
                baseView.serail12Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }


    public void wfh(String goods_model, String order_id) {
        addDisposable(apiServer.wfh(goods_model, order_id, "1","10000"), new BaseObserver<BaseModel<SerailBean1>>(baseView) {
            @Override
            public void onSuccess(BaseModel<SerailBean1> o) {
                baseView.getInto57Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }
    public void Into57(String type,String type_two,String type_two_status, String order_sn, String keywords) {
        addDisposable(apiServer.Into57(type, type_two, type_two_status, order_sn, keywords, "1","10000"), new BaseObserver<BaseModel<SerailBean1>>(baseView) {
            @Override
            public void onSuccess(BaseModel<SerailBean1> o) {
                baseView.getInto57Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }
    public void Into30(String order_sn, String date) {
        addDisposable(apiServer.Into30(order_sn, date), new BaseObserver<BaseModel<List<OutRecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<OutRecordListBean>> o) {
                baseView.getInto30Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into34(String order_sn) {
        addDisposable(apiServer.Into34(order_sn), new BaseObserver<BaseModel<List<RecordListBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<RecordListBean>> o) {
                baseView.getInto34Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void Into35(String order_sn, String date) {
        addDisposable(apiServer.Into35(order_sn, date), new BaseObserver<BaseModel<List<RecordBean>>>(baseView) {
            @Override
            public void onSuccess(BaseModel<List<RecordBean>> o) {
                baseView.getInto35Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void pub03(String order_type, String order_sn, String start_time, String end_time) {
        addDisposable(apiServer.pub03(order_type, order_sn, start_time, end_time), new BaseObserver<BaseModel<THRecordBean>>(baseView) {
            @Override
            public void onSuccess(BaseModel<THRecordBean> o) {
                baseView.getpub03Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }

    public void pub04(String order_type, String order_sn, String time) {
        addDisposable(apiServer.pub04(order_type, order_sn, time), new BaseObserver<BaseModel<THRecordBean>>(baseView) {
            @Override
            public void onSuccess(BaseModel<THRecordBean> o) {
                baseView.getpub04Success(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }
}
